package org.pzy.java.utils;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

/**
 * @Author: DRevelation
 * @Date: 2022/8/31 16:40
 */
public class DateUtils {
    public static long getTodayRemaining() {
        LocalDateTime midnight = LocalDateTime.now().plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
        return ChronoUnit.SECONDS.between(LocalDateTime.now(), midnight);
    }

    public static void main(String[] args) {
//        System.out.println(getTodayRemaining());
        DateTime date3 = DateUtil.date(1717632000000L);
        DateTime date4 = DateUtil.date(1717689599000L);
        System.out.println(date3);
        System.out.println(date4);
        // {"createTime":1717547190000,"endTime":1717689599000,"id":56,"publishId":30,"startTime":1717632000000,"status":1}

        System.out.println(DateUtil.endOfDay(date3));
        System.out.println(DateUtil.endOfDay(date4));

        String s = String.valueOf(123L);
        System.out.println("123".equals(123L));
        System.out.println("123".equals(s));
    }
}
